From 89f5ca3b5f16a1418b1ae4b2e36a6453a1dce309 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Wed, 10 Sep 2014 18:10:42 +0100 Subject: [PATCH] libxc/bitops: Add or() to the available bitmap operations Signed-off-by: Andrew Cooper CC: Ian Campbell CC: Ian Jackson Acked-by: Ian Campbell --- tools/libxc/xc_bitops.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/libxc/xc_bitops.h b/tools/libxc/xc_bitops.h index d8e0c168d7..dfce3b8695 100644 --- a/tools/libxc/xc_bitops.h +++ b/tools/libxc/xc_bitops.h @@ -60,4 +60,12 @@ static inline int test_and_set_bit(int nr, unsigned long *addr) return oldbit; } +static inline void bitmap_or(unsigned long *dst, const unsigned long *other, + int nr_bits) +{ + int i, nr_longs = (bitmap_size(nr_bits) / sizeof(unsigned long)); + for ( i = 0; i < nr_longs; ++i ) + dst[i] |= other[i]; +} + #endif /* XC_BITOPS_H */ -- 2.30.2